<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:42:"./views/home/mobile/account/chatinfo.phtml";i:1626589518;s:70:"/www/wwwroot/10.168.1.202/public/views/home/mobile/common/header.phtml";i:1541935408;}*/ ?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/html">

<head>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>聊天室</title>
     <link rel="shortcut icon" href="clientapp/images/new_images/favicon.ico" />
<link href="/static/home/mobile/css/reset_5.css" rel="stylesheet" type="text/css" />
<link href="/static/home/mobile/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/static/home/mobile/css/font-awesome.min.css">
<link href="/static/home/mobile/css/new_style.css" rel="stylesheet" type="text/css" />
<!-- 弹出层 -->
<link rel="stylesheet" href="/static/plugins/dialog/css/dialog.css" />
<script src="/static/home/mobile/js/jquery-2.0.3.min.js"></script>
<script src="/static/plugins/dialog/js/dialog.js"></script>
<!-- 弹出层 -->
<script type="text/javascript" src="/static/plugins/clipboard.min.js"></script>
<script type="text/javascript" src="/static/home/mobile/js/global.js?v=2"></script>
    <link href="/static/home/mobile/css/reset_5.css" rel="stylesheet" type="text/css"/>
    <link href="/static/home/mobile/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/static/home/mobile/css/new_style.css" rel="stylesheet" type="text/css"/>

  <style type="text/css">
  .white{background:#fff;}
        /** -- 文件上传样式 --**/
 .file-up {
    position: relative;
    display: inline-block;
    background:#fde03f;
    border: 1px solid #fde03f;
    border-radius: 4px;
    padding: 4px 12px;
    overflow: hidden;
    color:#834100;
    text-decoration: none;
    text-indent: 0;
    line-height: 20px;
   /*	height: 30px;*/
	min-width: 60px;
    font-size:12px;
   text-align: center;
}
.file-up input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
}
.file-up:hover {
    background: #AADFFD;
    border-color: #78C3F3;
    color: #004974;
    text-decoration: none;
}
     .file-up:link ,.file-up:visited{
        color:#834100;
      }

input:focus, textarea:focus {
    outline: none;
}



        .dialog {
          position: fixed;
          left: 0;
          top: 0;
          z-index: 10001;
          width: 100%;
          height: 100%;
        }
        .dialog-content {
            width: 70%;
        }
        .dialog-overlay {
          position: absolute;
          top: 0;
          left: 0;
          z-index: 10002;
          width: 100%;
          height: 100%;
          background-color: rgba(0, 0, 0, 0.5);
        }
        .member-form .item-box{border-bottom:1px solid #222;}
      html,body{background:#1a1a1a;}
  </style>
</head>
<body>
  <div class="site-header header-fixed" style="background-color:#0f0f0f;color:#fff;">
        <a onclick="history.back()" class="back" style="background:url('/static/home/mobile/login/back.png')no-repeat;
        background-size:15px 22px;width:15px;height:22px;"></a>
        <div class="tit-name" style="color:#fff;">&nbsp;&nbsp;&nbsp;
        	<?php echo $chat['receiver_name']; if($chat && !empty($chat['status']) && $chat['status']== 2): ?>
		        <div style="border-radius:5px;text-align:right;float:right;">已举报</div>
		        <?php else: ?>
		        <div onclick="jubao()" style="border-radius:5px;text-align:right;float:right;">举报</div>
		       <?php endif; ?>
        	
        	</div>
    </div>
    <br><br><br>
    <!--主题-->
    <div class="new-gold-detial">

</div>
<!--回复-->
    <div class="new-gold-detial" id="test2">
    <div class="update-box mx_list" id="table">

    <div class="update-box mx_list" id="tables" >
    <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$d): $mod = ($i % 2 );++$i;if($current_user_id != $d['uid']): ?>

       <div style="width:100%;margin-top: 30px;">
              <div style="float:left;width:20%;text-align: center;">
                      <img style="width:50px;height:50px;border-radius:50%;" src="<?php echo (isset($d['avatar']) && ($d['avatar'] !== '')?$d['avatar']:'http://10.168.1.202/uploads/20210730/e1d1e063b7fae7a0c98ea97d1f12fac6.png'); ?>" alt="">
                      <div style="width:50px;text-align:center;width:100%;"><?php echo $d['uid']; ?></div>
             </div>

            <div style="float:left;margin-top: 0px;padding:5px 10px;border-radius: 5px;background: #fff;line-height:30px;">
                           <?php if($d['img']): ?>
              <div style="width:100%;text-align:center;">

            <img src="<?php echo $d['img']; ?>" style="height:100px;" >
              </div>
              <?php else: ?>

              <?php echo $d['content']; endif; ?>
           </div>

            <div style="clear:both;"></div>
        </div>

         <div style="line-height:30px;color:#ccc;height:30px;text-align:center;width:100%;font-size:12px;"><?php echo $d['create_time']; ?></div>

        <?php endif; if($current_user_id == $d['uid']): ?>

       <div style="width:100%;margin-top: 30px;">
              <div style="float:right;width:20%;text-align: center;">
                      <img style="width:50px;height:50px;border-radius:50%;" src="<?php echo (isset($d['avatar']) && ($d['avatar'] !== '')?$d['avatar']:'http://10.168.1.202/uploads/20210730/e1d1e063b7fae7a0c98ea97d1f12fac6.png'); ?>" alt="">
             </div>

            <div style="float:right;margin-top: 20px;padding:5px 10px;border-radius: 5px;background: #0c6ce2;color:#FFFF;position:relative;line-height:30px;">
              <?php if($d['img']): ?>
              <div style="width:100%;text-align:center;">

            <img src="<?php echo $d['img']; ?>" style="height:100px;" >
              </div>
              <?php else: ?>

              <?php echo $d['content']; endif; ?>

           </div>


            <div style="clear:both;"></div>
        </div>
              <div style="line-height:30px;color:#ccc;height:30px;text-align:center;width:100%;font-size:12px;"><?php echo $d['create_time']; ?></div>


          <?php endif; if($d['adminMsg']): if(is_array($d['adminMsg']) || $d['adminMsg'] instanceof \think\Collection || $d['adminMsg'] instanceof \think\Paginator): $i = 0; $__LIST__ = $d['adminMsg'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$dd): $mod = ($i % 2 );++$i;if($dd['parent_id'] == $d['id']): ?>
       <div style="width:100%;margin-top: 30px;">
              <div style="float:left;width:20%;text-align: center;">
                      <img style="width:50px;height:50px;border-radius:50%;" src="http://10.168.1.202/uploads/20210730/e1d1e063b7fae7a0c98ea97d1f12fac6.png" alt="">
                      <div style="width:50px;text-align:center;width:100%;">管理员</div>
             </div>

            <div style="width:50%;float:left;margin-top: 0px;padding:20px;border-radius: 10px;background: #fff;line-height:30px;">
                           <?php if($dd['img']): ?>
              <div style="width:100%;text-align:center;">

            <img src="<?php echo $d['img']; ?>" style="height:100px;" >
              </div>
              <?php else: ?>

              <?php echo $dd['content']; endif; ?>
           </div>

            <div style="clear:both;"></div>
        </div>
    

         <div style="line-height:30px;color:#ccc;height:30px;text-align:center;width:100%;font-size:12px;"><?php echo $dd['create_time']; ?></div>
         <?php endif; endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>


</div>


    </div>
</div>

<div style="width:100%;background:#0f0f0f;height:60px;position:fixed;bottom:0;z-index:100;">
<div  style="width:10%;height:60px;line-height: 80px;margin-left:5%;float:left;">

<input type="file" id="upimg" style="width: 15%;height: 60px;z-index:100;position:absolute;top:0;left:0;opacity: 0; " class="file_up">
	<div style="background-color:#333;border:0px #b7b7b7 solid;width:30px;height:30px;float:left;border-radius: 50%; color:#b7b7b7;position:relative;text-align:center;margin-top:15px;"><i style="margin-top: -25px;text-align: center;display: block;font-size: 40px;">+</i></div>
  	</div>
  <div style="width:66%;float:left;">
    <textarea id="content" name="content"  style="width: 100%;height:30px;border:none;line-height:30px;resize: inherit;margin-top:15px;padding-left: 10px;" placeholder="在这里输入聊天内容"></textarea>
  </div>

  <div style="width:15%;float:right;text-align:center;line-height:80px;height:60px;" class="js-bind">
 <button style="width:80%;text-align:center;color:white;border-radius:10px;background-color:#0c6ce2;height:30px;margin-top: 15px;float:left;border-style: none;">发送</button
</div>

</div>

    <div class="main bindMail">
        <div class="member-form">
            <div class="item-box" style="height: auto;">

            </div>
        </div>


<div style="height:100%;width:100%;z-index: 1000;background: rgba(0,0,0,0.5);position: fixed;top:0;display: none;" id='imgDiv'>

  <img style="width:50%;margin-left: 25%;margin-top: 50%;" src="">

</div>


<form id="form1">
<!--   <div>
  <b style="font-size: 30px">图片：</b><a href="javascript:;" class="file-up">上传图片<input type="file" id="upimg" style="width: 300px;height: 40px;border-radius:9px;" class="file_up"></a>
</div> -->
  </form>
        <input type="hidden" id="img">

      <img src="" style="width: 200px;height: 180px; display: none" id="xianshi">
      <input type="hidden" id="cid" value="<?php echo $cid; ?>">
      <input type="hidden" id="tid" value="<?php echo $tid; ?>">
      <input type="hidden" id="uid" value="<?php echo $uid; ?>">

    </div>
     <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" />
 <script src="https://www.layuicdn.com/layui/layui.js"></script>
 <script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>

    <script type="text/javascript">


      function jubao() {
        let cid=$('#cid').val()

        if(!cid){
          layer.msg('请与雇主沟通后再举报')
          return;
        }

          $(document).dialog({
              type : 'confirm',
              titleText: '提示',
              content: '确定要举报吗？',
              onClickConfirmBtn: function(){
                  Common.loading.show();
                  $.post('/home/account/report.html', { cid: cid }, function(res) {
                      message(res.message,res.redirect,res.type);
                      Common.loading.hide();
                  });
              }
          });
      }


 $("body").on("click",".mx_list img",function(e){
 	
 	  ele=$('#imgDiv')

  ele.find('img').attr('src',e.target.src)
  ele.css('display','block')
  ele.on('click',function(){
    ele.css('display','none')

  })
  
 	/*
 	  layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 0,
		  shadeClose: true,
		  skin: 'chatimg',
		  content:`<img  src="`+e.target.src+`">`
		});
	*/	
        //layer.photos({ photos: {"data": [{"src": e.target.src}]} });
    });

      $('#upimg').change(function(){
        var form = new FormData(document.getElementById("form1"));
        form.append('upimg',$('#upimg')[0].files[0]);
        $.ajax({
          url: '/home/feedback/upimg',
          type: 'post',
          data:form,
          dataType: 'json',
          processData:false,
          contentType: false,
          success: function(res) {

                    if ($('#cid').val()=='') {


                        if ($('#tid').val()=='') {
                            return false;
                        }

                        $.post(
                            '/home/account/addchat',
                            {
                              content: '',
                              img:res.img,
                              task_id:$('#tid').val(),
                              uid:$('#uid').val(),
                            },
                            function (ret) {

                                message(ret.message,ret.redirect,ret.type);
                            },'json'
                        );

                  return;
                }

             let content={
                      content: '',
                      img:res.img,
                      cid:$('#cid').val(),
                      uid:$('#uid').val(),
                    }
                $.post('/home/account/chatinfo',
                   content,
                    function (ret) {
                        message(ret.message,ret.redirect,ret.type);
                    },'json'
                );

          }
        })
      })

        $(function () {
            $('.js-bind').click(function () {
                var content = $('#content').val();
                if ($.trim(content) == ""  ) {
                    message("至少有内容或者图片才可提交","","error");
                    return;
                }

                if ($('#cid').val()=='') {


                        if ($('#tid').val()=='') {
                            return false;
                        }
                        var content = $('#content').val();
                        if ($.trim(content) == "") {
                            message("至少有内容或者图片才可提交","","error");
                            return;
                        }
                        $.post(
                            '/home/account/addchat',
                            {
                              content: content,
                              img:$('#img').val(),
                              task_id:$('#tid').val(),
                              uid:$('#uid').val(),
                            },
                            function (ret) {

                                message(ret.message,ret.redirect,ret.type);
                            },'json'
                        );

                  return;
                }
                $.post(
                    '/home/account/chatinfo',
                    {
                      content: content,
                      img:'',
                      cid:$('#cid').val(),
                      uid:$('#uid').val()
                    },
                    function (ret) {
                        message(ret.message,ret.redirect,ret.type);
                    },'json'
                );
            });
        });
    </script>

</body>
</html>